﻿<%@ WebHandler Language="C#" Class="ConditionHandler" %>

using System;
using System.Web;
/// <summary>
/// 获取表单条件选项
/// </summary>
public class ConditionHandler : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";


        IConditionGetter conditGetter = new ConditionGetter();
        string action = context.Request["action"];

        string data_back = "";
        switch (action)
        {
            case "getCourseByTermStd":
                string term = context.Request["term"];
                string stdid = context.Request["stdid"];
                data_back = conditGetter.getCourseByTermStd(term, stdid);
                break;
            case "getExzamByCourseid":
                string courseid = context.Request["courseid"];
                data_back = conditGetter.getExzamByCourse(courseid);
                break;
            case "getCourseByTechTerm":
                string techid = context.Request["techid"];
                term = context.Request["term"];
                data_back = conditGetter.getCourseByTechTerm(techid, term);
                break;
            case "getExzamtype":
                term = context.Request["term"];
                data_back = conditGetter.getExzamtype();
                break;
            case "getExzamByCourseTech":
                techid = context.Request["techid"];
                courseid = context.Request["courseid"];
                data_back = conditGetter.getExzamByCourseTech(techid, courseid);
                break;
        }
        context.Response.Write(data_back);
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}